//=---------------------------------------------------------------------=
//
// $Id: AxPluginMgr.cpp,v 1.2 2004/02/27 14:26:38 stuart_hc Exp $ $Name: V113 $
//
// The contents of this file are subject to the AAF SDK Public
// Source License Agreement (the "License"); You may not use this file
// except in compliance with the License.  The License is available in
// AAFSDKPSL.TXT, or you may obtain a copy of the License from the AAF
// Association or its successor.
//
// Software distributed under the License is distributed on an "AS IS"
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See
// the License for the specific language governing rights and limitations
// under the License.
//
// The Original Code of this file is Copyright 1998-2004, Licensor of the
// AAF Association.
//
//=---------------------------------------------------------------------=

#include "AxPluginMgr.h"

AxPluginMgr::AxPluginMgr()
{
	AAFGetPluginManager( &_spIaafPluginMgr );
}

AxPluginMgr::AxPluginMgr( IAAFPluginManagerSP spIaafPluginMgr )
: _spIaafPluginMgr( spIaafPluginMgr )	
{}

AxPluginMgr::~AxPluginMgr()
{}

void AxPluginMgr::RegisterSharedPlugins()
{
	CHECK_HRESULT( _spIaafPluginMgr->RegisterSharedPlugins() );
}

IEnumAAFLoadedPluginsSP AxPluginMgr::EnumLoadedPlugins( const aafUID_t& categoryID )
{
	IEnumAAFLoadedPluginsSP spEnumLoadedPlugins;

	CHECK_HRESULT( _spIaafPluginMgr->EnumLoadedPlugins( categoryID, &spEnumLoadedPlugins ) );

	return spEnumLoadedPlugins;
}

IAAFDefObjectSP AxPluginMgr::CreatePluginDefinition( const aafUID_t& pluginDefID,
						  			 			     IAAFDictionarySP spDictionary )
{
	IAAFDefObjectSP spDefObjectSP;

	CHECK_HRESULT(
		_spIaafPluginMgr->CreatePluginDefinition( pluginDefID,
												  spDictionary,
												  &spDefObjectSP ) );

	return spDefObjectSP;
}

void AxPluginMgr::RegisterPluginFile( AxString pluginFileName )
{
	CHECK_HRESULT( _spIaafPluginMgr->RegisterPluginFile( pluginFileName.c_str() ) );
}
